<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Charts extends CI_Controller {

	private $data = array(
		'version' => '1.1.0'
	);

	public function __construct() {
		parent::__construct();
		
		$this->load->helper('url');

		// $this->output->enable_profiler(TRUE);
	}

	public function index()	{
		$this->load->view('charts.html', $this->data);
	}

	public function test() {
		$this->load->helper('number');

		echo '<pre>';

		var_dump(memory_get_usage());   //获取内存
		var_dump(memory_get_peak_usage());   //获取内存

		echo 'PID ' . getmypid() .'<br/>';




		echo '开始内存：'. byte_format(memory_get_usage(), 6), '<br/>'; 
		$tmp = str_repeat('hello', 1000);   
		echo '运行后内存：'.byte_format(memory_get_usage(), 4), '<br/>';  
		unset($tmp);   
		echo '回到正常内存：'.byte_format(memory_get_usage(), 5); 

		// echo counter_get() ;
		// echo getenv('HTTP_USER_AGENT');
	}
}
